from django.conf.urls import url
from rest_framework import routers

from . import views
from rest_framework_jwt.views import obtain_jwt_token

urlpatterns = [
    url(r'^user/$', views.UserDetailView.as_view()),
    url(r'^usernames/(?P<username>\w{5,20})/count/$', views.UsernameCountView.as_view()),
    url(r'^mobiles/(?P<mobile>1[3-9]\d{9})/count/$', views.MobileCountView.as_view()),
    url(r'^users/$', views.UserView.as_view()),
    url(r'^authorizations/$', obtain_jwt_token),
]


router1 = routers.DefaultRouter()
router1.register(r'work_experiences', views.UserWorkExperienceViewSet, base_name='work_experiences')

urlpatterns += router1.urls

router2 = routers.DefaultRouter()
router2.register(r'education_experiences', views.UserEducationExperienceViewSet, base_name='education_experiences')

urlpatterns += router2.urls